JS如何获取页面内所有的<img>标签元素?

来源:百度知道 编辑:UC知道 时间:2024/06/16 03:10:27
是这样的吗?
var anchors = document.getElementByTagName("img");

不过提示错误。怎么回事呢?
错误: document.getElementByTagName is not a function
行:32
原来通过获取id也可以读写html标签的各个属性...